/* utilities.vala
 *
 * Copyright (C) 2010, 2011  Richard Talbot-Watkins
 * Copyright (C) 2010, 2011  Dave Jeffery
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Authors:
 *  Richard Talbot-Watkins <richtw1@gmail.com>
 * 	Dave Jeffery <david.richard.jeffery@gmail.com>
 */

namespace BeebSpriter {
	/**
	 * Used by the dialog that appears when the user has unsaved work but
	 * tries to open or create a new file.
	 */
	private enum UserAction {
		NEW,
		OPEN,
		CLOSE
	}

	/**
	 * Used to hold a 32 bit RGBA value as four bytes.
	 */
	public struct Rgba {
		uint8 red;
		uint8 green;
		uint8 blue;
		uint8 alpha;

		/**
		 * Constructor function.
		 *
		 * @param red A byte value between 0 - 255.
		 * @param green A byte value between 0 - 255.
		 * @param blue A byte value between 0 - 255.
		 * @param alpha A byte value between 0 - 255.
		 */
		public Rgba (uint8 red, uint8 green, uint8 blue, uint8 alpha) {
			this.red = red;
			this.green = green;
			this.blue = blue;
			this.alpha = alpha;
		}
	}

	/**
	 * Gdk.EventExpose mouse buttons codes.
	 *
	 * There are more, but we're just interested in these two.
	 */
	private enum MouseButton {
		LEFT = 1,
		RIGHT = 3
	}

	/**
	 * Drag and Drop target code. 
	 *
	 * Beeb Spriter is only interested in receving URI's passed in from
	 * drag and drops from Nautilus.
	 */
	private enum Target {
		URI
	}

	/* Drag and Drop acceptable source objects. */
	private const Gtk.TargetEntry[] targets = {	
		{ "text/uri-list", 0, Target.URI } 
	};

	/* Drag and drop destination flags. */
	private const Gtk.DestDefaults destination_flags = Gtk.DestDefaults.ALL;

	/* If a file is dropped onto the window, we want to copy its URI. */
	private Gdk.DragAction actions = Gdk.DragAction.COPY;	
}
